<%@ page language="java" import="java.util.*,entitybean.oc_user_name.EntityBeanOc_User_Name,entitybean.systemtree.EntityBeanSystemtree" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List<EntityBeanSystemtree>list=(List<EntityBeanSystemtree>)request.getAttribute("list");
List<String>power_e=(List<String>)request.getAttribute("power_e");
EntityBeanOc_User_Name e =(EntityBeanOc_User_Name)request.getAttribute("e");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'edit_power_Application.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function power_me()
{
	var obj=window.confirm("确实要 更新 这些数据么?")
		var c_box=document.getElementsByName("c_box");
		//window.alert(c_box.length);
		var c_box_check="";
		for(var i=0;i<c_box.length;i++)
		{
			if(c_box[i].checked==true)
			{
				//window.alert(c_box[i].value);
				c_box_check=c_box[i].value+","+c_box_check;
				}
			}
		
		if(obj==true)
		{
			window.alert("提交表单 更新 数据");
			//window.alert("c_box_check="+c_box_check);
			document.getElementById("form1").action="<%=request.getContextPath()%>/admin_update_power_admin_info.do?method=admin_update_power_admin_info";
			document.getElementById("last_action").value=c_box_check;
			document.getElementById("form1").submit();
			
			}



}


</script>
  </head>
  
  <body>
   <form id="form1" name="form1" method="post" action="" >
   <input type="hidden" id="id" name="id" value="<%=e.getId()%>" />
   <input type="hidden" id="last_action" name="last_action" value="" />
    </form>
  <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#DBDBDB">
    <tr>
      <td width="20%" bgcolor="#eaebe3">选择</td>
      <td width="80%" bgcolor="#eaebe3">权限名称</td>
    </tr>
    <%for(int i=0;i<list.size();i++) {%>
    <tr>
      <td  bgcolor="#FFFFFF"><input <%if(power_e.contains(list.get(i).getF_jd().toString())){ %> checked <%} %> value="<%=list.get(i).getF_jd()%>"  type="checkbox" name="c_box" id="c_box" /></td>
      <td  bgcolor="#FFFFFF"><%=list.get(i).getJd_name() %></td>
    </tr>
    <% }%>
    <tr>
      <td  bgcolor="#FFFFFF">&nbsp;</td>
      <td  bgcolor="#FFFFFF"><input type="button" name="button" id="button" value="更新" onclick="power_me()"></td>
    </tr>
  </table>
    
    
    
    
    
  </body>
</html>
